
from celery import Celery

# 配置settings
import os
if not os.getenv('DJANGO_SETTINGS_MODULE'):
   os.environ['DJANGO_SETTINGS_MODULE'] = 'meiduo_mall.settings.dev'

# 创建Celery实例
celery_app = Celery('meiduo')

# 加载配置
celery_app.config_from_object('celery_tasks.config')

# 注册任务
celery_app.autodiscover_tasks([
   'celery_tasks.Email',
])

# celery -A celery_tasks.main worker -l info
# 进程
# --concurrency=4
# -c 4